﻿@model TCC.CMFlow.Models.CategoriaWebService

<div class="panel panel-primary">
    <div class="panel-heading clearfix">
        <h3 class="panel-title pull-left"><strong>Web Service</strong></h3>
    </div>
    <div class="panel-body">
        <div class="well well-sm">
            @Html.LabelFor(model => model.WebServiceUri)
            @Html.DisplayFor(model => model.WebServiceUri)

            <div class="pull-right">
                <a data-modal="" class="btn btn-success btn-sm" href="@Url.Action("TestarWebService", new { categoriaWorkflowID = Model.CategoriaWorkflowID })" id="btnConfigurarURI"><span class="glyphicon glyphicon-globe"></span> Testar Conectividade</a>
                <a data-modal="" class="btn btn-primary btn-sm" href="@Url.Action("ConfigurarWebServiceUri", new { categoriaWorkflowID = Model.CategoriaWorkflowID })" id="btnConfigurarURI"><span class="glyphicon glyphicon-link"></span> Definir</a>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-6">
                <div class="panel panel-default">
                    <div class="panel-heading clearfix">
                        <h3 class="panel-title pull-left"><strong>Serviço</strong></h3>
                        <div class="pull-right">
                            <a data-modal="" class="btn btn-primary btn-sm @(string.IsNullOrEmpty(Model.WebServiceUri) ? "disabled" : string.Empty)" href="@Url.Action("ConfigurarWebServiceServico", new { categoriaWorkflowID = Model.CategoriaWorkflowID })" id="btnConfigurarServico"><span class="glyphicon glyphicon-cog"></span> Configurar</a>
                        </div>
                    </div>
                    <div class="panel-body">
                        @if (Model != null)
                        {
                            @Html.DisplayFor(model => model.ServicoNome)
                        }
                    </div>
                </div>
            </div>

            <div class="col-lg-6">
                <div class="panel panel-default">
                    <div class="panel-heading clearfix">
                        <h3 class="panel-title pull-left"><strong>Operação</strong></h3>
                        <div class="pull-right">
                            <a data-modal="" class="btn btn-primary btn-sm @(string.IsNullOrEmpty(Model.WebServiceUri) || string.IsNullOrEmpty(Model.ServicoNome) ? "disabled" : string.Empty)" href="@Url.Action("ConfigurarWebServiceOperacao", new { categoriaWorkflowID = Model.CategoriaWorkflowID })" id="btnConfigurarOperacao"><span class="glyphicon glyphicon-cog"></span> Configurar</a>
                        </div>
                    </div>
                    <div class="panel-body">
                        @if (Model != null)
                        {
                            @Html.DisplayFor(model => model.OperacaoNome)
                        }
                    </div>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading clearfix">
                <h3 class="panel-title pull-left"><strong>Atributos</strong></h3>
                <div class="pull-right">
                    <a data-modal="" class="btn btn-primary btn-sm @(string.IsNullOrEmpty(Model.WebServiceUri) || string.IsNullOrEmpty(Model.ServicoNome) || string.IsNullOrEmpty(Model.OperacaoNome) ? "disabled" : string.Empty)" href="@Url.Action("ConfigurarWebServiceAtributos", new { categoriaWorkflowID = Model.CategoriaWorkflowID })" id="btnConfigurarAtributos"><span class="glyphicon glyphicon-cog"></span> Configurar</a>
                </div>
            </div>
            <div class="panel-body">
                @if (Model.CategoriaWebServiceAtributos != null && Model.CategoriaWebServiceAtributos.Any())
                {
                    <div class="panel-group" id="accordion">
                        @Html.Partial("_CategoriaWebServiceAtributos", Model.CategoriaWebServiceAtributos.Where(a => a.Parent == null))
                    </div>
                }
                else
                {
                    <div class="alert alert-info">
                        <center>Nenhum atributo configurado!</center>
                    </div>
                }
            </div>
        </div>

    </div>
</div>